// part1:C11:ex11.12.cpp
// read int sequence from string, store them to vector.
#include <iostream>
#include <fstream>
#include <utility>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(int argc, char *argv[])
{
  ifstream in(argv[1]);
  if (!in) {
    cout << "failed open input file!" << endl;
    exit(1);
  }

  vector<pair<string, int>> data;
  string s;
  int v;
  while (in >> s && in >> v) {
    data.push_back(pair<string, int>(s, v));
  }

  for (const auto &d : data) {
    cout << d.first << " " << d.second << endl;
  }  

  return 0;
}
